@extends('adminlte::page')

@section('title', '')

@section('content_header')
    {{--<h1></h1>--}}
@stop

@section('content')
    <div class="box">
        <div class="box-header with-border">
            <h3 class="box-title">轮播图列表(图片建议尺寸：1920*500)</h3>
            <div class="box-tools">
                <div class="input-group input-group-sm" style="width: 150px;">
                    <a href="{{ route('carousel.add') }}"><button type="button" class="btn btn-block btn-primary">添加轮播图</button></a>
                </div>
            </div>
        </div>
        <!-- /.box-header -->
        <div class="box-body">
            <table class="table table-bordered">
                <tbody><tr>
                    <th>图片</th>
                    <th>排序</th>
                    <th>操作</th>
                </tr>
                @foreach($carousels as $res)
                <tr>
                    <td>
                        <img src="{{ $res->path }}" alt="" width="100">
                    </td>
                    <td>
                        {{ $res->sort }}
                    </td>
                    <td>
                        <a type="button" href="{{ route('carousel.edit',['carousel'=>$res->id]) }}" class="btn btn-block btn-info btn-sm" style="width: 25%">修改</a>
                        <a type="button" class="btn btn-block btn-danger btn-sm" onclick="if (!confirm('确定要删除吗?')) { return false }" style="width: 25%" href="{{ route('carousel.delete', ['carousel'=>$res->id]) }}">删除</a>
                    </td>
                </tr>
                    @endforeach

                </tbody></table>
        </div>
    </div>
@stop